home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2002 November / SGI IRIX 6.5 Applications 2002 November.iso / dist / arraysvcs.idb / usr / include / arraysvcs.h.z / arraysvcs.h
Encoding:
C/C++ Source or Header  |  2002-02-28  |  18.1 KB  |  525 lines

  1. /* $Id: arraysvcs.h,v 1.53 2002/02/13 19:31:56 n6965 Exp $ */
  2. #ifndef __ARRAYSVCS_H__
  3. #define __ARRAYSVCS_H__
  4.  
  5. /*
  6.  * arraysvcs.h
  7.  *
  8.  *    Interfaces for the array services library
  9.  *
  10.  * Copyright 1995, Silicon Graphics, Inc.
  11.  * ALL RIGHTS RESERVED
  12.  *
  13.  * UNPUBLISHED -- Rights reserved under the copyright laws of the United
  14.  * States.   Use of a copyright notice is precautionary only and does not
  15.  * imply publication or disclosure.
  16.  *
  17.  * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  18.  * Use, duplication or disclosure by the Government is subject to restrictions
  19.  * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  20.  * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  21.  * in similar or successor clauses in the FAR, or the DOD or NASA FAR
  22.  * Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  23.  * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  24.  *
  25.  * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  26.  * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  27.  * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  28.  * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  29.  * GRAPHICS, INC.
  30.  */
  31.  
  32.  
  33.  
  34. #if defined(_LANGUAGE_C_PLUS_PLUS)
  35. extern "C" {
  36. #endif
  37.  
  38. #include <sys/types.h>
  39. #include <netinet/in.h>
  40.  
  41. #ifdef LINUX
  42. #include "arraysvcs_linux.h"
  43. #endif
  44.  
  45. #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
  46.  
  47.  
  48. /*
  49.  * Basic types
  50.  */
  51.  
  52. typedef uintptr_t    asserver_t;    /* Server token */
  53.  
  54. typedef uint64_t    askey_t;    /* Authentication key */
  55. #define AS_NOKEY    0        /* No key specified */
  56.  
  57. typedef uint16_t    asident_t;    /* Entity identifier */
  58.  
  59.  
  60.  
  61. /*
  62.  * error handling
  63.  *    Most array services store a result code in the global variable
  64.  *    "aserrorcode".  This result code may actually contain several
  65.  *    fields.  A general summary of the error code, similar to the
  66.  *    standard "errno", can be found in "aserrno".
  67.  */
  68.  
  69. /* Error code declarations */
  70. typedef __uint32_t aserror_t;
  71.  
  72. #define aserrnoc(E)    ((E) & 255)
  73. #define aserrwhatc(E)  (((E) >> 8) & 255)
  74. #define aserrwhyc(E)   (((E) >> 16) & 255)
  75. #define aserrextrac(E) ((E) >> 24)
  76.  
  77. extern aserror_t aserrorcode;
  78.  
  79. #define aserrno    (aserrnoc(aserrorcode))
  80. #define aserrwhat  (aserrwhatc(aserrorcode))
  81. #define aserrwhy   (aserrwhyc(aserrorcode))
  82. #define aserrextra (aserrextrac(aserrorcode))
  83.  
  84.  
  85. /* Error summary numbers */
  86. #define ASE_OK        0        /* Operation successful */
  87. #define ASE_SYSERROR    1        /* System operation failed */
  88. #define ASE_BADVALUE    2        /* Invalid value/argument */
  89. #define ASE_REQFAILED    3        /* Request failed */
  90. #define ASE_BADCOMMAND    4        /* Invalid command */
  91. #define ASE_PROTOCOL    5        /* Protocol error */
  92. #define ASE_INTERNAL    6        /* Internal error */
  93. #define ASE_NOARRAYSVCS 7        /* Array services not installed */
  94.  
  95. /* ASE_OK "why" codes ("what" is undefined) */
  96. #define ASOK_COMPLETED    0        /* Command/request completed */
  97. #define ASOK_INITIATED    1        /* Command started, may not be done */
  98. #define ASOK_CONNECT    2        /* Initiate connection */
  99. #define ASOK_CONNECTED    3        /* Connection completed */
  100.  
  101. /* ASE_NOARRAYSVCS has no "what" or "why" code */
  102.  
  103. /* ASE_SYSERROR "what" codes.  ("why" == errno) */
  104. #define ASSE_UNKNOWN    0        /* Origin unknown */
  105. #define ASSE_CMDFORK    1        /* Command process fork */
  106. #define ASSE_REQFORK    2        /* Request process fork */
  107. #define ASSE_WAIT    3        /* Wait for process */
  108. #define ASSE_SELECT    4        /* Wait for event */
  109. #define ASSE_READHDR    5        /* Read message header */
  110. #define ASSE_READBODY    6        /* Read message body */
  111. #define ASSE_WRITEHDR    7        /* Write message header */
  112. #define ASSE_WRITEBODY    8        /* Write message body */
  113. #define ASSE_GETASH    9        /* Extract ASH */
  114. #define ASSE_PIDSINASH    10        /* Extract PIDs in ASH */
  115. #define ASSE_ACCEPT    11        /* Accept client connection */
  116. #define ASSE_SOCKET    12        /* Create socket */
  117. #define ASSE_CONNECT    13        /* Connect to server */
  118. #define ASSE_SETSOCKOPT 14        /* Set socket options */
  119. #define ASSE_BIND    15        /* Bind name to socket */
  120. #define ASSE_LISTEN    16        /* Listen for connections */
  121. #define ASSE_WRITEOUT    17        /* Write output data */
  122. #define ASSE_OPENPROCD    18        /* Open procfs directory */
  123. #define ASSE_OPENOUT    19        /* Open output file */
  124. #define ASSE_STATOUT    20        /* Stat output file */
  125. #define ASSE_READOUT    21        /* Read output file */
  126. #define ASSE_ENUMASHS    22        /* Enumerate ASHs */
  127. #define ASSE_PEERNAME    23        /* Get peer name */
  128. #define ASSE_SOCKNAME    24        /* Get socket name */
  129. #define ASSE_STATUDS    25        /* Stat unix domain socket */
  130. #define ASSE_IOCTLNBIO    26        /* Make socket non-blocking */
  131. #define ASSE_GETSRVOPT  27        /* Get server option */
  132. #define ASSE_KILL    28        /* Send signal to process */
  133. #define ASSE_SETUID    29        /* Set user ID */
  134. #define ASSE_UNAME    30        /* Get OS information */
  135. #define ASSE_GETSPINFO    31        /* Get Service Provider Info */
  136. #define ASSE_ARSOP    32        /* Array Session Operation */
  137. #define ASSE_GETPRIO    33        /* Get scheduling priority */
  138. #define ASSE_GETRLIM    34        /* Get resource limit */
  139. #define ASSE_CHMOD    35        /* Change file permissions */
  140. #define ASSE_MONFORK    36        /* Monitor process fork */
  141.  
  142. /* ASE_BADVALUE "what" codes */
  143. #define ASBV_UNKNOWN    0        /* Unknown value */
  144. #define ASBV_PORTNUM    1        /* Port number */
  145. #define ASBV_ARRAY    2        /* Array name */
  146. #define ASBV_HOST    3        /* Host name */
  147. #define ASBV_SRVTOKEN    4        /* Server token */
  148. #define ASBV_OPTNAME    5        /* Option name */
  149. #define ASBV_OPTVAL    6        /* Option value */
  150. #define ASBV_PID    7        /* Process ID */
  151. #define ASBV_DEST       8        /* Destination */
  152. #define ASBV_CONNECT    9        /* Connection info */
  153. #define ASBV_ADDRFAMILY 10        /* Address family */
  154. #define ASBV_OPTINFO    11        /* Options information */
  155. #define ASBV_ARGS    12        /* Command line arguments */
  156. #define ASBV_TARGET    13        /* Target of signal */
  157.  
  158. /* ASE_BADVALUE "why" codes */
  159. #define ASBVY_UNKNOWN    0        /* Do not know why */
  160. #define ASBVY_RANGE    1        /* Value out of range */
  161. #define ASBVY_PARSE    2        /* Cannot parse value */
  162. #define ASBVY_NOTFOUND    3        /* Value not found */
  163. #define ASBVY_SIZE    4        /* Size of value is invalid */
  164. #define ASBVY_INVALID    5        /* Value generally invalid */
  165. #define ASBVY_NODEFAULT 6        /* No default for unspecified value */
  166.  
  167. /* ASE_REQFAILED "why" codes  ("what" is undefined) */
  168. #define ASRFY_UNKNOWN    0        /* Do not know why */
  169. #define ASRFY_VERSION    1        /* Wrong version of arrayd */
  170. #define ASRFY_TIMEOUT    2        /* Timed out waiting for command */
  171. #define ASRFY_BADOS    3        /* Wrong version of IRIX */
  172. #define ASRFY_NOCONNECT    4        /* Unable to connect interactively */
  173. #define ASRFY_BADCLIENT 5        /* Client connection invalid */
  174. #define ASRFY_CONNECTTO 6        /* Interactive connection timed out */
  175. #define ASRFY_BADAUTH    7        /* Authentication error */
  176.  
  177. /* ASE_BADCOMMAND "why" codes ("what" is undefined) */
  178. #define ASBCY_UNKNOWN    0        /* Do not know why */
  179. #define ASBCY_NOTFOUND    1        /* Command not found */
  180. #define ASBCY_EMPTY    2        /* Nothing to INVOKE */
  181. #define ASBCY_BADUSER    3        /* Invalid USER */
  182. #define ASBCY_BADGROUP    4        /* Invalid GROUP */
  183. #define ASBCY_BADPROJ    5        /* Invalid PROJECT */
  184. #define ASBCY_ILLMERGE  6        /* MERGE illegal for request */
  185. #define ASBCY_NOINFO    7        /* No command info provided */
  186.  
  187. /* Error functions */
  188. aserror_t asmakeerror(int, int, int, int);
  189. void asperror(const char *, ...);
  190. const char *asstrerror(aserror_t);
  191. int asperrlog(asserver_t, ash_t ASH, const char *, ...);
  192. int aserrlogstat(asserver_t, ash_t);
  193.  
  194.  
  195. /* Destination flags */
  196. #define ASDST_NONE   0            /* Destination not specified */
  197. #define ASDST_LOCAL  1            /* Local machine only */
  198. #define ASDST_SERVER 2            /* Specified server only */
  199. #define ASDST_ARRAY  3            /* Specified array */
  200.  
  201.  
  202. /*
  203.  * Server functions
  204.  *    Most array commands take an optional "asserver_t" argument to
  205.  *    specify an array server other than the default. These functions
  206.  *    create/destroy these tokens and modify options associated with them.
  207.  */
  208. asserver_t asopenserver(const char *, int);
  209. void       ascloseserver(asserver_t);
  210.  
  211. int asdfltserveropt(int, void *, int *);
  212. int asgetserveropt(asserver_t, int, void *, int *);
  213. int assetserveropt(asserver_t, int, const void *, int);
  214.  
  215. /* Server option names */
  216. #define AS_SO_TIMEOUT    1    /* Response timeout value */
  217. #define AS_SO_CTIMEOUT    2    /* Connection timeout value */
  218. #define AS_SO_FORWARD    3    /* Forwarding on/off */
  219. #define AS_SO_LOCALKEY  4    /* Local authentication key */
  220. #define AS_SO_REMOTEKEY 5    /* Remote authentication key */
  221. #define AS_SO_PORTNUM    6    /* Port number (dflt only) */
  222. #define AS_SO_HOSTNAME    7    /* Host name (dflt only) */
  223.  
  224.  
  225. /*
  226.  * ASH functions
  227.  */
  228. ash_t asallocash(asserver_t, const char *);
  229. int   asashisglobal(ash_t);
  230. ash_t asashofpid(pid_t);
  231.  
  232. typedef struct aspidlist {
  233.     int    numpids;    /* Number of PIDs in list */
  234.     pid_t   *pids;        /* Array of PIDs */
  235. } aspidlist_t;
  236.  
  237. typedef struct asmachinepidlist {
  238.     int       numpids;    /* Number of PIDs in list */
  239.     pid_t       *pids;    /* Array of PIDs */
  240.     const char *machname;    /* Name of machine */
  241.     char       rsrvd[44];    /* reserved for expansion */
  242. } asmachinepidlist_t;
  243.  
  244. typedef struct asarraypidlist {
  245.     int        nummachines;    /* Number of machines in list */
  246.     asmachinepidlist_t **machines;    /* List of asmachpidlist_t's */
  247.     const char    *arrayname;    /* Name of array */
  248.     char        rsrvd[44];    /* reserved for expansion */
  249. } asarraypidlist_t;
  250.  
  251. aspidlist_t *aspidsinash(ash_t);
  252. aspidlist_t *aspidsinash_local(ash_t);
  253. asmachinepidlist_t *aspidsinash_server(asserver_t, ash_t);
  254. asarraypidlist_t *aspidsinash_array(asserver_t, const char *, ash_t);
  255.  
  256.  
  257. /*
  258.  * Array command functions
  259.  */
  260. typedef struct ascmdreq {
  261.     char     *array;    /* Name of target array */
  262.     uint32_t flags;        /* Option flags */
  263.     int     numargs;    /* Number of arguments */
  264.     char     **args;    /* Cmd arguments (ala argv) */
  265.     uint32_t ioflags;    /* I/O flags for interactive commands */
  266.  
  267.     char     rsrvd[100];    /* reserved for expansion: init to 0's */
  268. } ascmdreq_t;
  269.  
  270. #define ASCMDREQ_LOCAL        0x80000000    /* Do not broadcast to array */
  271. #define ASCMDREQ_NEWSESS    0x40000000    /* Start new array session */
  272. #define ASCMDREQ_OUTPUT        0x20000000    /* Collect output from cmd */
  273. #define ASCMDREQ_NOWAIT        0x10000000    /* Do not wait on command */
  274. #define ASCMDREQ_INTERACTIVE    0x08000000    /* Run interactively */ 
  275.  
  276. #define ASCMDIO_STDIN        0x80000000    /* Provide stdin to command */
  277. #define ASCMDIO_STDOUT        0x40000000    /* Provide stdout to command */
  278. #define ASCMDIO_STDERR        0x20000000    /* Provide stderr to command */
  279. #define ASCMDIO_SIGNAL        0x10000000    /* Send signals to command */
  280. #define ASCMDIO_OUTERRSHR    0x08000000    /* Provide stderr via stdout */
  281. #define ASCMDIO_ERRLOG        0x04000000    /* Log stderr to a logfile.
  282.                          * ASCMDIO_STDERR, 
  283.                          * ASCMDIO_FULLIO or  
  284.                          * ASCMDIO_OUTERRSHR will
  285.                          * override this flag 
  286.                          */
  287.  
  288. #define ASCMDIO_FULLIO        (ASCMDIO_STDIN  | \
  289.                  ASCMDIO_STDOUT | \
  290.                  ASCMDIO_STDERR | \
  291.                  ASCMDIO_SIGNAL)    /* Provide full I/O */
  292.  
  293.  
  294. typedef struct ascmdrslt {
  295.     char      *machine;    /* Name of responding machine */
  296.     ash_t      ash;        /* ASH of running command */
  297.     uint32_t  flags;    /* Result flags */
  298.     aserror_t error;    /* Error code for this command */
  299.     int      status;    /* Exit status */
  300.     char      *outfile;    /* Name of output file */
  301.  
  302.     uint32_t  ioflags;    /* I/O connections (see ascmdreq_t) */
  303.     int      stdinfd;    /* File descriptor for command's stdin */
  304.     int      stdoutfd;    /* File descriptor for command's stdout */
  305.     int      stderrfd;    /* File descriptor for command's stderr */
  306.     int      signalfd;    /* File descriptor for sending signals */
  307.  
  308.     /* stay tuned for future expansion */
  309. } ascmdrslt_t;
  310.  
  311. #define ASCMDRSLT_OUTPUT    0x80000000    /* Output available */
  312. #define ASCMDRSLT_MERGED    0x40000000    /* Output is merged */
  313. #define ASCMDRSLT_ASH        0x20000000    /* ASH is available */
  314. #define ASCMDRSLT_INTERACTIVE    0x10000000    /* I/O connections available */
  315.  
  316.  
  317. typedef struct ascmdrsltlist {
  318.     int    numresults;    /* Number of ascmdrslt_t's */
  319.     ascmdrslt_t **results;    /* Array of ascmdrslt_t pointers */
  320. } ascmdrsltlist_t;
  321.  
  322.  
  323. ascmdrsltlist_t *ascommand(asserver_t, const ascmdreq_t *);
  324.  
  325.  
  326. /*
  327.  * Remote execution functions
  328.  */
  329. int asrcmd(asserver_t, char *, char *, int *);
  330. int asrcmdv(asserver_t, char *, char **, int *);
  331.  
  332.  
  333.  
  334. /*
  335.  * aslist<> functions
  336.  *    These functions return a malloc'ed list of items of the specified
  337.  *    type containing configuration or status information. The corresponding
  338.  *    "asfree<>" functions may be used to release the storage allocated by
  339.  *    the "aslist<>" functions.
  340.  */
  341. typedef struct asarray {
  342.     const char *name;        /* Name of array */
  343.     int       numattrs;        /* Number of attribute strings */
  344.     const char **attrs;        /* List of attribute strings */
  345.     u_short       ident;        /* Array ID */
  346. } asarray_t;
  347.  
  348. typedef struct asarraylist {
  349.     int      numarrays;        /* Number of arrays in list */
  350.     asarray_t **arrays;        /* Array of asarray_t pointers */
  351. } asarraylist_t;
  352.  
  353. asarray_t *asgetdfltarray(asserver_t);
  354. asarraylist_t *aslistarrays(asserver_t);
  355.  
  356.  
  357. typedef struct asashlist {
  358.     int    numashs;        /* Number of ASHs in list */
  359.     ash_t   *ashs;            /* Array of ASHs */
  360. } asashlist_t;
  361.  
  362. asashlist_t *aslistashs(asserver_t, const char *, int Dest, uint32_t Flags);
  363. asashlist_t *aslistashs_array(asserver_t, const char *);
  364. asashlist_t *aslistashs_local(void);
  365. asashlist_t *aslistashs_server(asserver_t);
  366.  
  367. /* Control flags for aslistashs */
  368. #define ASLAF_NOLOCAL    0x00000001    /* Global ASHs only */
  369. #define ASLAF_NODUPS    0x00000002    /* Remove duplicate ASHs */
  370. #define ASLAF_NODUPES    0x00000002    /* (for compatibility) */
  371.  
  372.  
  373. typedef struct asmachine {
  374.     const char     *name;        /* Familiar name of machine */
  375.     const char     *hostname;    /* Network hostname of machine */
  376.     int           numattrs;    /* Number of attribute strings */
  377.     const char     **attrs;        /* List of attribute strings */
  378.     struct in_addr inaddr;        /* IP address of machine */
  379.     u_short           portnum;        /* Port # of array daemon */
  380.     asident_t      ident;        /* ID of array daemon */
  381. } asmachine_t;
  382.  
  383. typedef struct asmachinelist {
  384.     int    nummachines;        /* Number of machines in list */
  385.     asmachine_t **machines;        /* Array of asmachine_t pointers */
  386. } asmachinelist_t;
  387.  
  388. asmachinelist_t *aslistmachines(asserver_t, const char *ArrayName);
  389.  
  390.  
  391. /*
  392.  * asfree<> functions
  393.  *    These functions are used to release the storage allocated by other
  394.  *    libarray functions (e.g. the aslist<> functions)
  395.  */
  396. void asfreearray(asarray_t *, uint32_t);
  397. void asfreearraylist(asarraylist_t *, uint32_t);
  398. void asfreearraypidlist(asarraypidlist_t *, uint32_t);
  399. void asfreeashlist(asashlist_t *, uint32_t);
  400. void asfreecmdrslt(ascmdrslt_t *, uint32_t);
  401. void asfreecmdrsltlist(ascmdrsltlist_t *, uint32_t);
  402. void asfreemachine(asmachine_t *, uint32_t);
  403. void asfreemachinelist(asmachinelist_t *, uint32_t);
  404. void asfreemachinepidlist(asmachinepidlist_t *, uint32_t);
  405. void asfreepidlist(aspidlist_t *, uint32_t);
  406.  
  407. #define ASFLF_FREEDATA    0x80000000    /* Free individual list items */
  408. #define ASFLF_UNLINK    0x40000000    /* Unlink temporary files */
  409. #define ASFLF_CLOSEIO    0x20000000    /* Close I/O connections */
  410. #define ASFLF_CLOSESRV    0x10000000    /* Close server token */
  411.  
  412.  
  413. /*
  414.  * Option parsing functions
  415.  *    Used by array services clients to provide a standard set of
  416.  *    command line options.
  417.  */
  418. typedef struct asoptinfo {
  419.     int    argc;        /* Number of unparsed arguments */
  420.     char    **argv;        /* Array of ptrs to unparsed arguments */
  421.  
  422.     int    valid;        /* Bitmap of valid fields */
  423.     int    invalid;    /* Bitmap of fields with invalid arguments */
  424.     int    options;    /* Option flags */
  425.  
  426.     asserver_t token;    /* Token for specified server */
  427.  
  428.     char    *server;    /* ASCII name of target server */
  429.     char    *array;        /* Name of array to operate on */
  430.     askey_t    localkey;    /* Local authentication key */
  431.     askey_t remotekey;    /* Remote authentication key */
  432.     ash_t    ash;        /* ASH to operate on */
  433.     pid_t    pid;        /* PID to operate on */
  434.     int    portnum;    /* Port number of arrayd */
  435.     int    timeout;    /* Response timeout in seconds */
  436.     int    connectto;    /* Connect timeout in seconds */
  437.     int    verbose;    /* Verbose level */
  438. } asoptinfo_t;
  439.  
  440. /* Select/Valid flags */
  441. #define ASOIV_TOKEN    0x00000001    /* Server token */
  442. #define ASOIV_SERVER    0x00000002    /* Server name */
  443. #define ASOIV_ARRAY    0x00000004    /* Array name */
  444. #define ASOIV_LCLKEY    0x00000008    /* Local authentication key */
  445. #define ASOIV_REMKEY    0x00000010    /* Remote authentication key */
  446. #define ASOIV_ASH    0x00000020    /* Array session handle */
  447. #define ASOIV_PID    0x00000040    /* Process ID */
  448. #define ASOIV_PORTNUM    0x00000080    /* Port number */
  449. #define ASOIV_TIMEOUT    0x00000100    /* Timeout */
  450. #define ASOIV_CONNECTTO 0x00000200    /* Connect timeout */
  451. #define ASOIV_VERBOSE    0x00000400    /* Verbose level */
  452. #define ASOIV_FORWARD    0x00000800    /* Forwarding mode */
  453. #define ASOIV_LOCAL    0x00001000    /* Local mode */
  454.  
  455. #define ASOIV_STD    (ASOIV_SERVER | ASOIV_ARRAY | ASOIV_LCLKEY | \
  456.              ASOIV_REMKEY | ASOIV_PORTNUM | ASOIV_TIMEOUT | \
  457.              ASOIV_CONNECTTO | ASOIV_FORWARD)
  458.  
  459. /* Option flags */
  460. #define ASOIO_LOCAL    0x00000001    /* Local machine only */
  461. #define ASOIO_FORWARD    0x00000002    /* Forward request via local server */
  462.  
  463. /* Control flags */
  464. #define ASOIC_LOGERRS    0x00000001    /* Print error messages */
  465. #define ASOIC_NODUPS    0x00000002    /* Do not allow redundant args */
  466. #define ASOIC_OPTSONLY    0x00000004    /* Stop at first non-option arg */
  467. #define ASOIC_SELONLY    0x00000008    /* Stop at first unselected arg */
  468.  
  469. void asfreeoptinfo(asoptinfo_t *, uint32_t);
  470. asserver_t  asopenserver_from_optinfo(const asoptinfo_t *);
  471. asoptinfo_t *asparseopts(int argc, char **argv, int select, int control);
  472.  
  473.  
  474. /* Signal functions */
  475. int askillpid_server(asserver_t, pid_t, int signum);
  476.  
  477. int askillash_array(asserver_t, const char *array, ash_t, int signum);
  478. int askillash_local(ash_t, int signum);
  479. int askillash_server(asserver_t, ash_t, int signum);
  480.  
  481. /* Signal functions - with Ignore PID feature */
  482. int askillash_array_ign(asserver_t, const char *array, ash_t,
  483.                 int signum, aspidlist_t *);
  484. int askillash_local_ign(ash_t, int signum, aspidlist_t *);
  485. int askillash_server_ign(asserver_t, ash_t, int signum, aspidlist_t *);
  486.  
  487.  
  488. /*
  489.  * Constants pertaining to ASH's and PRID's
  490.  */
  491. #ifndef lint
  492. #define ASBADASH    -1LL    /* An invalid Array Session Handle */
  493. #define ASMINASH    0LL    /* Smallest valid Array Session Handle */
  494. #define ASNOASH        0LL    /* "No ASH specified" */
  495. #define ASASHMASK    0x7FFFFFFFFFFFFFFFLL    /* Valid ASH bits */
  496.  
  497. #define ASBADPRID    -1LL    /* An invalid project ID */
  498. #define ASMINPRID    0LL    /* Smallest valid project ID */
  499. #define ASNOPRID    0LL    /* "No project ID specified" */
  500.  
  501. #else
  502. /* Bogus values that don't use lint-unfriendly "LL" */
  503. #define ASBADASH    -1
  504. #define ASMINASH    0
  505. #define ASNOASH        0
  506. #define ASASHMASK    0x7FFFFFFF
  507. #define ASBADPRID    -1
  508. #define ASMINPRID    0
  509. #define ASNOPRID    0
  510. #endif
  511.  
  512.  
  513. /*
  514.  * Miscellaneous functions
  515.  */
  516. const char *asgetattr(const char *, const char **, int);
  517.  
  518. #endif /* C || C++ */
  519.  
  520. #if defined(_LANGUAGE_C_PLUS_PLUS)
  521. }
  522. #endif
  523.  
  524. #endif  /* !__ARRAYSVCS_H_ */
  525.